local jusun = fk.CreateSkill {
  name = "th_jusun",
}

jusun:addEffect(fk.TurnStart, {
  name = "th_jusun",
  can_trigger = function(self, event, target, player, data)
    return target and target ~= player and not target.dead and player:hasSkill(jusun.name)
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {
      skill_name = jusun.name,
      prompt = "#th_jusun-ask::"..target.id
    })
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local use = room:askToPlayCard(target, {
      skill_name = jusun.name,
      prompt = "#th_jusun-use::"..player.id,
      extra_data = { bypass_times = true },
      cancelable = true
    })
    if not use then
      player:drawCards(2, jusun.name)
    end
  end
})

Fk:loadTranslationTable{
  ["th_jusun"] = "居喰",
  [":th_jusun"] = "其他角色回合开始时，你可以令其使用一张牌，若其未使用牌，你摸两张牌。",

  ["#th_jusun-ask"] = "居喰：你可以令 %dest 使用一张牌，若其未使用牌，你摸两张牌",
  ["#th_jusun-use"] = "居喰：你需使用一张牌，否则 %dest 摸两张牌",
}

return jusun